package com.stony.support.serializer;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.alibaba.fastjson.serializer.SerializeWriter;

import java.io.IOException;
import java.lang.reflect.Type;

/**
 * Created by ShiHui on 2014/7/3.
 */
public class ObjectIdSerializer implements ObjectSerializer {
    public static ObjectIdSerializer instance = new ObjectIdSerializer();
    @Override
    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
        SerializeWriter out = serializer.getWriter();
        out.writeString(object.toString());
    }
}
